package com.cinyi.cyds.util;

import org.apache.log4j.Logger;
import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;

/**
 * Created by root on 1/7/15.
 */
public class DynamicDataSource extends AbstractRoutingDataSource {
    public static final Logger logger = Logger.getLogger(DynamicDataSource.class.toString());

    @Override
    protected Object determineCurrentLookupKey() {
        String key = ContextHolder.getDbType();//获得当前数据源标识符
        return key;
    }

}